package com.financial.business.integral.controller;


import com.financial.business.integral.service.yd.FinancialYDIntegralPayAsynService;
import com.financial.business.integral.service.yd.FinancialYDIntegralPaymentAsynService;
import com.financial.business.integral.utils.apiresult.ApiResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
 * @api {post} /business/integral
 * @apiExample
 * author WANGNING
 * tar 积分业务异步回执
 * date 2019年10月29日
 * @apiGroup balance-integral
 * @apiVersion 1.0.0
 * @apiHeader {String} null 无
 * @apiParam {String} null 无
 * @apiSuccess {String} succeed 就绪
 */

@RestController
@RequestMapping("/integralCallback")
public class FinancialIntegralCallBackController {

    @Autowired
    private FinancialYDIntegralPayAsynService financialYDIntegralPayAsynService;

    @Autowired
    private FinancialYDIntegralPaymentAsynService financialYDIntegralPaymentAsynService;

    /**
     * 优店积分支付异步回调地址
     * @param reqMap
     * @return
     */
    @PostMapping("/yd/pay")
    public ApiResult ydPay(@RequestParam Map<String,Object> reqMap){

        return financialYDIntegralPayAsynService.payAsyn(reqMap);
    }

    /**
     * 优店积分代付异步回调地址
     * @param reqMap
     * @return
     */
    @PostMapping("/yd/payment")
    public ApiResult ydPayment(@RequestParam Map<String,Object> reqMap){

        return financialYDIntegralPaymentAsynService.paymentAsyn(reqMap);
    }
}
